home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / xlisp2.1 / xldist01.zoo / lsp / edit.lsp < prev    next >
Encoding:
Lisp/Scheme  |  1990-11-09  |  813 b   |  31 lines

  1. ;;;(setq *breakenable* t)
  2. ;;;(setq *tracenable* t)
  3.  
  4. ;;;
  5. ;;; This variable is the default file to edit
  6. ;;;
  7.  
  8. (defvar *edit-file* "")
  9.  
  10. (defvar *editor* "eps")
  11.  
  12. ;;;
  13. ;;; edit a file using the specified editor
  14. ;;; if the file editted was a lisp file (.lsp) load it
  15. ;;;
  16.  
  17. (defun edit (&optional file)
  18.     (read-char)
  19.     (when file (setq *edit-file* (string file)))
  20.     (when (not (member #\.
  21.                (get-output-stream-list
  22.               (make-string-input-stream *edit-file*))))
  23.       (setq *edit-file* (strcat *edit-file* ".lsp")))
  24.     (unless (system (strcat *editor* " " *edit-file*))
  25.           (error (strcat "Unable to execute: " *editor* " " *edit-file*)))
  26.     (let ((len (length *edit-file*)))
  27.       (when (and (> len 4)
  28.          (string= (string-downcase (subseq *edit-file* (- len 4)))
  29.               ".lsp"))
  30.         (load *edit-file*))))
  31.